import type { Banner, Category, Hot, GuessItem, Guess } from '@/types/home'
import type { PageResult, PageParams } from '@/types/globe'
import { http } from '@/utils/http'

export const getBannerDataAPI = (distributionSite = 1) => {
  return http<Banner[]>({
    method: 'GET',
    url: '/home/banner',
    data: { distributionSite },
  })
}
export const getCategoryDataAPI = () => {
  return http<Category[]>({
    method: 'GET',
    url: '/home/category/mutli',
    data: {},
  })
}
export const getHotDataAPI = () => {
  return http<Hot[]>({
    method: 'GET',
    url: '/home/hot/mutli',
    data: {},
  })
}
export const getGuessDataAPI = (limit = 4) => {
  return http<Guess[]>({
    method: 'GET',
    url: '/home/new',
    data: { limit },
  })
}

export const getGuessLikeDataAPI = (data?: PageParams) => {
  return http<PageResult<GuessItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data,
  })
}
